package com.company.visitor;

public class Computer {

    ComputerPart cpu = new Cpu();

    ComputerPart memory = new Memory();

    ComputerPart board = new Board();

    public void accept(Visitor v) {
        this.cpu.accept(v);
        this.board.accept(v);
        this.board.accept(v);
    }

    public static void main(String[] args) {
        PersonelVisitor p = new PersonelVisitor();
        new Computer().accept(p);
        System.out.println(p.totalPrice);
    }

}
